[+ autogen5 template +]
dnl Process this file with autoconf to produce a configure script.
dnl Created by Anjuta application wizard.

AC_INIT([+NameHLower+], [+Version+])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([src/config.h])
AM_MAINTAINER_MODE

AC_NO_EXECUTABLES
AC_PROG_CC([avr-gcc])

[+IF (=(get "HaveLangCPP") "1")+]
AC_PROG_CXX([avr-g++])
[+ENDIF+]

AM_CFLAGS="-g \
	-fpack-struct -fshort-enums \
	-funsigned-bitfields -funsigned-char \
	-Wall -Wstrict-prototypes"

AC_ARG_WITH([mcu],
	AS_HELP_STRING([--with-mcu], [Set type AVR microcontroller]),
	MCU="$withval")

AC_SUBST(MCU)
AC_DEFINE_UNQUOTED(MCU,
      "${MCU}",
	  [Type of microcontroller])

AC_ARG_WITH([cpu-freq],
	AS_HELP_STRING([--with-cpu-freq], [Set CPU clock frequency]),
	CPU_FREQ="$withval")

AC_SUBST(CPU_FREQ)

if [ test -n "$MCU" ]; then
	MMCU_CFLAGS="-mmcu=$MMCU"
fi

if [ test -n "$CPU_FREQ" ]; then
	AC_DEFINE_UNQUOTED(F_CPU,
      "${CPU_FREQ}",
	  [CPU clock frequency])
fi

AM_CFLAGS="$AM_CFLAGS $MMCU_CFLAGS"
AC_SUBST(AM_CFLAGS)

AC_OUTPUT([
Makefile
src/Makefile
])

echo "-------------------------------------------------------------------"

echo "AVR Microcontroller type: $MMCU"
echo "CPU clock frequency: $CPU_FREQ"
echo
